@extends('app')

@section('content')

<div class="panel panel-primary" style="margin-top: 50px">
    <div class="panel-heading">
        添加用户
    </div>
    <div class="panel-body">
        <form class="form-horizontal" method="POST" action="{{url('admin/add/')}}">
        	{!! csrf_field() !!}
        	<div class="col-md-12">
			    <div class="form-group">
			    	<label class="col-sm-3 control-label">邮箱:</label>
			    	<div class="col-sm-9">
			    		<input type="email" name="email" class="form-control" placeholder="Email" value="{{ old('email') }}">
			    	</div>
			    </div>
			    <div class="form-group">
			    	<label class="col-sm-3 control-label">用户名:</label>
			    	<div class="col-sm-9">
			    	<input type="name" class="form-control" placeholder="Name" name="name" value="{{ old('name') }}">
			    	</div>
			    </div>
			    <div class="form-group">
			    	<label class="col-sm-3 control-label">密码:</label>
			    	<div class="col-sm-9">
			    	<input type="password2" class="form-control" placeholder="Password" name="password">
			    	</div>
			    </div>
			    <div class="form-group">
			    	<label class="col-sm-3 control-label">确认密码:</label>
			    	<div class="col-sm-9">
			    		<input type="password2" class="form-control" placeholder="Password Again" name="password_confirmation"></div>
			    </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">角色：</label>
			        <div class="col-sm-9">
			            <select class="form-control" name="role[]">
			            @foreach($allRoles as $role)
			            	@if($role->name != 'god')
				                <option value="{{$role->id}}">{{$role->display_name}}</option>
				            @endif
			            @endforeach
			            </select>
			        </div>
			    </div>
			</div>

			<div class="form-group">
                <div class="col-sm-4 col-sm-offset-2">
                    <button type="submit" class="btn btn-primary">添加</button>
                    <a class="btn btn-white" href="{{url('/')}}">返回</a>
                </div>
            </div>
        </form>
    </div>
    @include('errors.errors')

</div>
@stop






